package com.physics.mps.module.comsol.vo;

import com.physics.mps.entity.vo.StartComputeVo;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import org.springframework.util.CollectionUtils;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author mcsoft
 * @date 2023/10/16 16:13
 * @description comsol模型参数
 */
@Getter
@Setter
@ToString
@NoArgsConstructor
public class ComsolSolveVo extends StartComputeVo implements Serializable {

    private static final long serialVersionUID = 835359979650319006L;


    /**
     * 任务ID
     */
    private String subTaskId;


    /**
     * stp文件路径
     */
    private String stpPath;

    /**
     * 材料列表
     */
    private List<MaterialVo> materials;

    /**
     * 载荷列表
     */
    private List<PhysicsVo> physics;

    /**
     * 网格列表
     */
    private List<MeshVo> meshes;

    /**
     * 研究
     */
    private StudyVo studyVo;

    /**
     * 多物理
     */
    private MultiPhysicsVo multiPhysicsVo;

    /**
     * 几何
     */
    private GeomVo geomVo;

    /**
     * commonFeature
     */
    private CommonFeatureVo commonFeatureVo;

    /**
     * function
     */
    private List<FunctionVo> functionVos;

    /**
     * resultVo
     */
    private ResultVo resultVo;

    /**
     * className
     */
    private String className;

    /**
     * map
     */
    private Map<String, String> map;

    /**
     * 不运行
     */
    private boolean noRun;

    /**
     * 一致边界对
     */
    private List<PairVo> pairVos;



    public ComsolSolveVo(ComsolVo comsolVo) {
        super.setAppId(comsolVo.getAppId());
        super.setAppModuleId(comsolVo.getAppModuleId());
        super.setTaskName(comsolVo.getTaskName());
        this.stpPath = comsolVo.getStpPath();
        this.subTaskId = comsolVo.getSubTaskId();
    }


    public Map<String, String> getMap() {
        if (CollectionUtils.isEmpty(map)) {
            map = new HashMap<>();
        }
        return map;
    }
}
